home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_15_1987_Transactor_Publishing.d64 / freq cntr.bas (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  927b  |  28 lines

  1. 10 rem ------- frequency counter ------
  2. 20 rem --------- lorne klassen --------
  3. 30 rem ------- east kelowna,b.c. ------
  4. 40 :
  5. 50 rem  uses cnt2 (pin #6) on the user port to read in the frequency.
  6. 60 rem  any signal applied to this pin must be at ttl level.
  7. 70 rem  count is stored at 680 and 681.
  8. 80 rem  gate time is stored at 822,            overflow at 823
  9. 90 :
  10. 100 c=c+1:ifc=1thenload"freq.cntr.@c000",8,1
  11. 110 cx=-1
  12. 120 print"[147]"tab(12)"frequency counter"
  13. 130 printtab(12)"-----------------"
  14. 140 print:printtab(6)" press '+' for 1 sec. gate"
  15. 150 print:printtab(6)" press '-' for 0.1 sec. gate"
  16. 160 print:printtab(10)"any other key to quit"
  17. 170 sys 49152:rem  start address
  18. 180 c=peek(680)+256*peek(681):ifc=cxthen230:rem count has not changed
  19. 190 print"       [157][157][157][157][157][157][157]";c;d$,"cycles per second"
  20. 200 cx=c
  21. 210 ifpeek(823)thenprint"overflow"
  22. 220 ifpeek(823)=0thenprint"        ":rem 8 spaces
  23. 230 geta$:ifa$=""then180
  24. 240 ifa$="+"thenpoke822,60:d$="":goto180
  25. 250 ifa$="-"thenpoke822,6:d$="[157]0":goto180
  26. 260 sys 49155:rem  disconnect address
  27. 270 end
  28.